﻿
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using Microsoft.Practices.Repository;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DotNetCore.BannerManagement.Domain;
using System.Data.SqlClient;

namespace DotNetCore.BannerManagement.DAL.Domain.dnc_ZoneImageRepositoryArtifacts
{
    /// <summary>
    /// Construct a dnc_ZoneImage object from OUT and IN/OUT parameters.
    /// </summary>
    internal sealed class Getdnc_ZoneImageByIdFactory : IDomainObjectFactory<dnc_ZoneImage>
    {

        #region IDomainObjectFactory<dnc_ZoneImage> Members

        public dnc_ZoneImage Construct(IDataReader reader)
        {
            dnc_ZoneImage dnc_ZoneImage = new dnc_ZoneImage();

            int zoneIDIndex = reader.GetOrdinal("ID");
            if (!reader.IsDBNull(zoneIDIndex))
            {
                dnc_ZoneImage.Id = reader.GetInt32(zoneIDIndex);

            }

            int zoneNameIndex = reader.GetOrdinal("Name");
            if (!reader.IsDBNull(zoneNameIndex))
            {
                dnc_ZoneImage.Name = reader.GetString(zoneNameIndex);

            }

            int imageHeightIndex = reader.GetOrdinal("ImageHeight");
            if (!reader.IsDBNull(imageHeightIndex))
            {
                dnc_ZoneImage.ImageHeight = reader.GetDecimal(imageHeightIndex);

            }

            int imageWidthIndex = reader.GetOrdinal("ImageWidth");
            if (!reader.IsDBNull(imageWidthIndex))
            {
                dnc_ZoneImage.ImageWidth = reader.GetDecimal(imageWidthIndex);

            }

            return dnc_ZoneImage;
        }

        #endregion
    }
}

